﻿@model PagedList.IPagedList<MvcAtletIS.Models.Articles>
@{
    ViewBag.Title = "Zo sveta";
}
        
<h2>Zo sveta</h2>

<div class="paging-box">
    
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "WorldNews", new { page = 1  })
        @Html.Raw(" ");
        @Html.ActionLink("<", "WorldNews", new { page = Model.PageNumber - 1 })
    }

    Strana @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) z @Model.PageCount
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink(">", "WorldNews", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "WorldNews", new { page = Model.PageCount })
    }
        
</div>

    @foreach (var commonArticle in Model)
    { 
        <div class="article">
            <div id="next-articles">
                @commonArticle.Title
            </div>

            @*<img src="@Url.Content("~/Content/articles/" + commonArticle.ImagePath)" alt="commonArticle.Name" align="left" class="article-image" />*@
                
            <div class="article-image">
                <img src="@Url.Content("~/Content/articles/" + commonArticle.ImagePath)" alt="commonArticle.Name" width="300px" />
                
                @if (!string.IsNullOrEmpty(commonArticle.ImageText))
                {
                <p>
                    @Html.Raw(commonArticle.ImageText)
                </p>
                }
            </div>

            <p class="article-perex">
                @commonArticle.Perex
            </p>
               
            <p class="article-text">
                <b>
                    @commonArticle.City
                    @commonArticle.Date.Value.ToLongDateString()
                    (@commonArticle.Editor)
                </b>
                @Html.Raw(commonArticle.Text)
            </p>
        </div>
    }

<div class="paging-box">
    
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "WorldNews", new { page = 1  })
        @Html.Raw(" ");
        @Html.ActionLink("<", "WorldNews", new { page = Model.PageNumber - 1 })
    }

    Strana @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) z @Model.PageCount
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink(">", "WorldNews", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "WorldNews", new { page = Model.PageCount })
    }
        
</div>
    
